<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2
 * @license    GNU/GPL
*/
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
/**
 * HTML View class for the JobsWorld Component
 *
 * @package    JobsWorld
 */
 
class JobsViewIndholdViewCaterer extends JView
{
    function display($tpl = null)
    {
		global $mainframe, $option;
       	$model = &$this->getModel();
		$session =& JFactory::getSession();
		//$data = JModel::getInstance( 'Jobs', 'JobsModel');
		//$this->assignRef('data',		$data);
		
		$user		= JFactory::getUser();
		
		$is_user = false; 
		$is_user_caterer = false; 
		foreach ($user->groups as $key => $value){
			if($value==9) {
				$is_user_caterer = true; 
			}
			if($value==2) {
				$is_user = true; 
			}
		}
		
		$id = JRequest::getVar('eventid');
		$paid =  $model->checkUserPaid($user->get('id'),$id);
		
		$allUsers = $model->getAllUsersInOrder($id);
		
		$item = $model->getOrder($id);
		
		$this->assignRef( 'item',	$item );
		$this->assignRef('row',$row);
		$this->assignRef('allUsers',$allUsers);
		
		$eventrating = $model->getUsersRatingOfEvent($id);
		//$eventrating = NULL;
		$this->assignRef('eventrating',$eventrating);
		$this->assignRef('paid',$paid);
		
		
        parent::display($tpl);
    }
}
?>